package com.ruoyi.service.impl;

import java.util.List;

import com.ruoyi.domain.ResidentTask;
import com.ruoyi.mapper.ResidentTaskMapper;
import com.ruoyi.service.IResidentTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 住户核酸任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-10
 */
@Service
public class ResidentTaskServiceImpl implements IResidentTaskService
{
    @Autowired
    private ResidentTaskMapper residentTaskMapper;

    /**
     * 查询住户核酸任务
     * 
     * @param id 住户核酸任务主键
     * @return 住户核酸任务
     */
    @Override
    public ResidentTask selectResidentTaskById(Long id)
    {
        return residentTaskMapper.selectResidentTaskById(id);
    }

    /**
     * 查询住户核酸任务列表
     * 
     * @param residentTask 住户核酸任务
     * @return 住户核酸任务
     */
    @Override
    public List<ResidentTask> selectResidentTaskList(ResidentTask residentTask)
    {
        return residentTaskMapper.selectResidentTaskList(residentTask);
    }

    /**
     * 新增住户核酸任务
     * 
     * @param residentTask 住户核酸任务
     * @return 结果
     */
    @Override
    public int insertResidentTask(ResidentTask residentTask)
    {
        residentTask.setState(-1L);
        return residentTaskMapper.insertResidentTask(residentTask);
    }

    /**
     * 修改住户核酸任务
     * 
     * @param residentTask 住户核酸任务
     * @return 结果
     */
    @Override
    public int updateResidentTask(ResidentTask residentTask)
    {
        return residentTaskMapper.updateResidentTask(residentTask);
    }

    /**
     * 批量删除住户核酸任务
     * 
     * @param ids 需要删除的住户核酸任务主键
     * @return 结果
     */
    @Override
    public int deleteResidentTaskByIds(Long[] ids)
    {
        return residentTaskMapper.deleteResidentTaskByIds(ids);
    }

    /**
     * 删除住户核酸任务信息
     * 
     * @param id 住户核酸任务主键
     * @return 结果
     */
    @Override
    public int deleteResidentTaskById(Long id)
    {
        return residentTaskMapper.deleteResidentTaskById(id);
    }
}
